package com.bw.database.dao

import androidx.room.*
import com.bw.database.entity.TestEntity

@Dao
interface TestInfoDao {

    //vararg代表可以批量操作,1或多
    @Insert(onConflict = OnConflictStrategy.IGNORE)
     suspend fun insertTestInfo(vararg testInfo: TestEntity)

    @Delete
    suspend fun deleteTestInfo(vararg testInfo: TestEntity)

    @Update
    suspend fun updateTestInfo(vararg testInfo: TestEntity)

    @Query("select * from test_info order by id")
    suspend fun queryAllTestInfo():List<TestEntity>


    @Query("select * from test_info where id = :id")
    suspend fun queryTestById(id:Int):TestEntity


}